package com.olt.dao.user;

import com.olt.domain.user.OltPower;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


@SuppressWarnings("MybatisXMapperMethodInspection")
public interface IPowerDao extends JpaRepository<OltPower,Long> {

    OltPower getByPowerName(String name);


    List<OltPower> findAllByPowerNameNotIn(List<String> name);

    @Query(value = "select distinct p from OltPower p left join RolePower r on r.powerId=p.powerId where r.roleId in ?1")
    List<OltPower> findByRoleId(List<Long> roleId);


}

